package com.he.ymw.service.impl;

import com.github.pagehelper.PageHelper;
import com.he.ymw.dao.ProductDao;
import com.he.ymw.pojo.Product;
import com.he.ymw.service.ProductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {

    @Resource
    ProductDao productDao;

    @Override
    public List<Product> findProducts(String name, Integer page) {
        return productDao.findProducts(name,page);
    }

    @Override
    public List<Product> findProducts2(Integer page,Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        return productDao.findProducts2();
    }
}
